#ifndef SIMPLESCREENCAPTUREHANDLER_H
#define SIMPLESCREENCAPTUREHANDLER_H

#include <osgViewer/Viewer>
#include <osgGA/GUIEventHandler>
#include <osgDB/WriteFile>

class SimpleScreenCaptureHandler : public osgGA::GUIEventHandler
{
public:
    SimpleScreenCaptureHandler(osgViewer::Viewer* viewer, const std::string& saveDir);

    bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&) override;

    void capture();

private:
    osgViewer::Viewer* _viewer;
    std::string _saveDir;
    bool _captureNextFrame;
};

#endif // SIMPLESCREENCAPTUREHANDLER_H
